Quick demo¶
In [1]:
from pathlib import Path
from mrimate.mrimate import MRImateExperiment
/home/rserial/.cache/pypoetry/virtualenvs/mrimate-GazfC78H-py3.9/lib/python3.9/site-packages/numpy/_core/getlimits.py:545: UserWarning: Signature b'\x00\xd0\xcc\xcc\xcc\xcc\xcc\xcc\xfb\xbf\x00\x00\x00\x00\x00\x00' for <class 'numpy.longdouble'> does not match any known type: falling back to type probe function. This warnings indicates broken support for the dtype! machar = _get_machar(dtype)
Data directory¶
In [2]:
filepath = Path("/mnt/c/Users/Raque/Dropbox/TUHH/projects/MRI3T_data_analysis/Aug-20240812T081905Z-001/Aug/HBR-09/")
filename = "ha_20240809_171936_19_3_wipdelrecpos"
Experiment loading¶
In [3]:
experiment = MRImateExperiment(filepath, filename)
experiment.load()
experiment.describe()
Experiment Details: - Examination Name: hannah-bubble-reacto - Type: 2D - Date: August 09, 2024 Scan Information: - Technique: TFE - Dimension: 2D - Resolution: 176x88 pixels - Slices: 1 - Dynamics: 10 - Flow Encoding: Yes - Diffusion Encoding: No
Calculating velocity (only working for 1d for now)¶
In [4]:
experiment.calculate_velocity()
Accessing spin density and phase/velocity images (in case of velocity encoding)¶
In [5]:
spin_density = experiment.get_spin_density()
phase = experiment.get_phase()
velocity = experiment.get_velocity()
Exporting data to hdf5¶
Exports spin density, and phase/velocity in case of flow encoded experiments. Didn't check the hdf5 files are exported ok.
In [6]:
experiment.export_to_hdf5(filepath=Path('.'), filename='experiment_data.h5')
Data exported to experiment_data.h5 successfully.
Plotting proton density¶
You can choose two different plot types: "dynamics" or "slices". Either way you can choose the slice or dynamic id you want to plot. 3d plots are not possible right now.
In [7]:
experiment.plot_proton_density(plot_type='slices', dynamic_idx=-1, rotate_xy_axes=True)
In [8]:
experiment.plot_proton_density(plot_type='dynamics', slice_idx=0, rotate_xy_axes=True)
Plotting velocity data¶
In [9]:
experiment.plot_velocity(plot_type="dynamics", slice_idx=0, rotate_xy_axes=True)